package com.bangdream.michelia.view.fragment.main.home;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bangdream.michelia.R;
import com.bangdream.michelia.presenter.base.BasePresenter;
import com.bangdream.michelia.view.fragment.currency.BaseFragment;

/**
 * @date on 2018/6/18 23:54
 * @email 909732184@qq.com
 */
public class HomeAdFragment extends BaseFragment {
    private View view;
    private ImageView ivIcon;
    private String stTilte;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.home_ad_item,container,false);
        return view;
    }
    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initView();
    }

    @Override
    public BasePresenter createPresenter() {
        return null;
    }

    private void initView() {
        ivIcon = view.findViewById(R.id.ivIcon);
        if(getArguments()!=null){
            stTilte = getArguments().getString("data");
        }
        switch (stTilte){
            case "1":
                ivIcon.setImageResource(R.mipmap.icon_temp_curriculum1);
                break;
            case "2":
                ivIcon.setImageResource(R.mipmap.icon_temp_curriculum2);
                break;
            case "3":
                ivIcon.setImageResource(R.mipmap.icon_temp_curriculum3);
                break;
            default:
                ivIcon.setImageResource(R.mipmap.icon_temp_curriculum3);
                break;
        }
    }

}
